package com.xdcplus.web.common.pojo.dto.pm;

import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * 排班管理(PmShiftManage)表查询入参DTO类
 * 
 * @author Fish.Fei
 * @since 2023-02-07 17:06:14
 */
@Data
@EqualsAndHashCode()
@ApiModel(description = "")
@SuppressWarnings("serial")
public class PmShiftManageFilterDTO implements Serializable {
    private static final long serialVersionUID = 729738133309851456L;

    @ApiModelProperty("$column.comment")
    private Long id;

    @ApiModelProperty("序号")
    private Long serialNo;

    @ApiModelProperty("工作班制")
    private Long shiftType;

    @ApiModelProperty("班次编码")
    private String shiftCode;

    @ApiModelProperty("班次名称")
    private String shiftName;

    @ApiModelProperty("日期调整")
    private Long dataAdjust;

    @ApiModelProperty("起始时间")
    private String startTime;

    @ApiModelProperty("结束时间")
    private String endTime;

    @ApiModelProperty("图标编码")
    private String faCode;

    @ApiModelProperty("创建人")
    private String createdUser;

    @ApiModelProperty("创建时间")
    private Timestamp createdTime;

    @ApiModelProperty("更新人")
    private String updatedUser;

    @ApiModelProperty("更新时间")
    private Timestamp updatedTime;

    @ApiModelProperty("班次属性")
    private String shiftAttribute;

    @ApiModelProperty("班次编码(模糊查询)")
    private String shiftCodeKeyword;

    @ApiModelProperty("班次名称(模糊查询)")
    private String shiftNameKeyword;

    /**
     * 每页数据数量
     */
    @ApiModelProperty(value = "每页数据数量 (默认20)")
    @Min(value = 0,message = "参数必须大于0")
    private Integer pageSize;

    /**
     * 页码(开始页:1, 默认1，-1：所有)
     */
    @ApiModelProperty(value = "页码(开始页:0, 默认 0，-1：所有)",required = true)
    @NotNull(message = "参数必传，传-1代表不分页")
    @Min(value = -1,message = "参数必须大于-1")
    private Integer currentPage;

    /**
     * 排序类型（asc,desc）
     */
    @ApiModelProperty("排序类型（asc,desc） 默认 desc")
    private String orderType;

    /**
     * 排序字段
     */
    @ApiModelProperty("排序字段")
    private String orderField;

    public Integer getCurrentPage() {
        return ObjectUtil.isNull(currentPage) ? 0 : currentPage;
    }

}
